import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '@/pages/HomePage.vue'
import { HomeOutlined } from '@ant-design/icons-vue'
import DataUpload from '@/pages/DataUpload/DataUpload.vue'
import HistoryRecord from '@/pages/HistoryRecord/HistoryRecord.vue'
import RealTime from '@/pages/realTime/RealTime.vue'
import DefectDetail from '@/pages/DefectDetail/DefectDetail.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomePage,
      meta:{
        title:'首页',
        icon: HomeOutlined,
        order: 1
      }
    },
    {
      path: '/DataUpload',
      name: 'DataUpload',
      component: DataUpload,
      meta:{
        title:'数据上传',
        order: 2
      }
    },
    {
      path: '/RealTime',
      name: 'RealTime',
      component: RealTime,
      meta:{
        title:'实时监测',
        order: 3
      }
    },
    {
      path: '/defect/:id', // 动态路由，:id 是参数
      name: 'DefectDetail',
      component: DefectDetail,
      props: true, // 开启 props 传递，方便组件接收参数
        meta: {
          title: '缺陷详情',
          hideInMenu: true,
        },
    },
    {
      path: '/HistoryRecord',
      name: 'HistoryRecord',
      component: HistoryRecord,
      meta:{
        title:'检测历史',
        order: 4
      }
    },
    // {
    //   path: '/user/login',
    //   name: '用户登录',
    //   component: UserLoginPage,
    //   meta: {
    //     title: '用户登录',
    //     hideInMenu: true,
    //   },
    // },
    // {
    //   path: '/user/register',
    //   name: '用户注册',
    //   component: UserRegisterPage,
    //   meta: {
    //     hideInMenu: true,
    //   },
    // },
    // {
    //   path: '/admin/userManage',
    //   name: '用户管理',
    //   component: UserManagePage,
    //   meta: {
    //     title: '用户管理',
    //     access: ACCESS_ENUM.ADMIN,
    //     order: 5,
    //   },
    // },
  ],
})

export default router
